//
//  NSString+WXUtils.m
//  WXUtils
//
//  Created by qianxia on 15/11/20.
//  Copyright © 2015年 黄旺鑫. All rights reserved.
//

#import "NSString+WXUtils.h"

@implementation NSString (WXUtils)

/**
 *  判断字符串不为空
 *
 *  @return 当为YES, string不为nil, 并且length大于0
 */
- (BOOL)isNonEmpty {
    
    BOOL isNonEmpty = ![self isEqual:[NSNull null]] && self.length > 0;
    
    return isNonEmpty;
}

/**
 *  对网址进行编码
 *
 */
- (NSString *)encodedURLQuery {
    return [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
}

@end
